import java.util.Scanner;

import boundary.Hovedmenu;
import boundary.IHovedmenu;
import controller.Controller;
import controller.IController;
import entity.DALException;
import entity.WeightApp;
import functionality.IOperatoerDAO;
import functionality.OperatoerDAO;


public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		
		WeightApp app = new WeightApp(scan);
		IOperatoerDAO oprFunc = new OperatoerDAO();
		IHovedmenu menu = new Hovedmenu(scan);
		IController cont = new Controller(menu, oprFunc, app);
		try {
			oprFunc.createOperatoer("Jacob", "Jepsen", "270284-2121");
			oprFunc.createOperatoer("BO", "Bosen", "260614-2122");
			oprFunc.createOperatoer("Ole", "Kristians", "240694-4021");
			System.out.println("Opr11 password: " + oprFunc.getOperatoer(11).getPassword());
			System.out.println("Opr12 password: " + oprFunc.getOperatoer(12).getPassword());
			System.out.println("Opr13 password: " + oprFunc.getOperatoer(13).getPassword());
			cont.start();
		} catch (DALException e) {
			System.out.println("DALException fanget! Systemet afsluttes");
			e.printStackTrace();
			System.exit(1);
		} finally {
			scan.close();
		}
	}
}
